Skip to content

Add safeguard to CUDA runtime bindings for device initialization#100

Open
asindarov wants to merge 1 commit into
libmir:masterfrom
asindarov:asadbek-fix-cuda-device-initialization-failure
Open

Add safeguard to CUDA runtime bindings for device initialization#100
asindarov wants to merge 1 commit into
libmir:masterfrom
asindarov:asadbek-fix-cuda-device-initialization-failure

Conversation

@asindarov

@asindarov asindarov commented Jul 2, 2026

Copy link
Copy Markdown

Hello, this PR fixes silent failure on hardware that does not have CUDA device.

shared static this()
{
_initPlatform();
if (__dcompute_reflect(ReflectTarget.CUDA,0)) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, does this work?
Pretty sure this will always be false for host code.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asindarov asindarov Jul 2, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it worked on my mac, I don't have computer with nvidia chip, therefore cannot check the true case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants